
import { connector, createApp, Session ,I_encodeDecodeConfig} from "mydog";
import { 编码解码器 } from "./app/buf/encode_decode";
let app = createApp();

app.setConfig("connector", { "connector": connector.Ws, "clientOnCb": clientOnCb, "clientOffCb": clientOffCb });
//配置编码解码器
app.setConfig("encodeDecode", 编码解码器());
app.start();

process.on("uncaughtException", function (err: any) {
    console.log(err)
});

function clientOnCb(session: Session) {
    console.log("客户端连接",session.getIp);
}

function clientOffCb(session: Session) {
    console.log("客户端关闭",session.uid);
}